<?php
include("session.php");
include("config.php");

$fallback = "maintime.php";
$loc_entity = RLang("customer");
$row = prepare_edit(LEVEL_EDIT_CUSTOMER, LEVEL_CREATE_CUSTOMER, "edit_customer.php", $loc_entity, "customer", $db, $fallback);
if (!$row)
   exit();



$readonly = $row['retired'] != null;
$action = "write_customer.php";
$fields = [
   ["name" => "name", "loc" => RLang("name"), "type" => "text", "limit" => 50],
   ["name" => "street", "loc" => RLang("street"), "type" => "text", "limit" => 50],
   ["name" => "nr", "loc" => RLang("number"), "type" => "number", "limit" => 4],
   ["name" => "postcode", "loc" => RLang("postcode"), "type" => "text", "limit" => 12],
   ["name" => "city", "loc" => RLang("city"), "type" => "text", "limit" => 30],
   ["name" => "created", "loc" => RLang("created"), "type" => "text", "readonly" => true],
];

include("itable_editor.php");
